<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>获取经纬度数据</title>
</head>
<!--访问地址：http://localhost:8080/ayUser/findMap-->
<body><div id="map" style="width:800px;height: 500px;">数据生成中...</div>
<script>
    var datas = '' //从网页上复制的JSONP数据
    //获取区县数据
    //getTownDataJsonFromJsonP(datas)
    //区县数据需要手动通过url地址从网页上复制的JSONP数据获取
    function getTownDataJsonFromJsonP(datas){
        var jsonData = datas.replace(/^jsonp\(/g,"").replace(/\)$/g,"");
        //console.log(JSON.parse(jsonData)); //这里打印出来的是json格式的数据
        var townList = [],data = JSON.parse(jsonData);
        var list = data.features;
        var dt="数据生成成功！！！================================<br/>"
        for(var i=0,j=list.length;i<j;i++){
            var temp = list[i].properties;
            townList.push([temp.adcode,temp.fullname,temp.drilldown,temp.filename,temp.longitude,
                temp.latitude,temp.name,temp.parent,(temp.adcode+"").substring(0,4),temp.childrenNum,(temp.level=="district"?3:temp.level)]);
        }
        //console.log(townList)
        for(var i=0,j=townList.length;i<j;i++){
            dt+=townList[i]+"<br/>"
        }
        document.getElementById("map").innerHTML=dt
    }
</script>
<script th:src="@{/js/jquery-3.3.1.min.js}"></script>
<script th:src="@{/js/get-map-info.js}"></script>
<script th:src="@{/js/file-save.js}"></script>
</body></html>